Skip to content

feat(api/prometheus): add format_query endpoint for query formatting#1846

Merged
bwplotka merged 2 commits into
prometheus:mainfrom
yshngg:feature/format-query
Aug 20, 2025
Merged

feat(api/prometheus): add format_query endpoint for query formatting#1846
bwplotka merged 2 commits into
prometheus:mainfrom
yshngg:feature/format-query

Conversation

@yshngg

@yshngg yshngg commented Jul 30, 2025

Copy link
Copy Markdown
Contributor

The changes introduce a new /format_query API endpoint to handle query formatting in the Prometheus API.

This includes implementing the FormatQuery function in api.go and adding corresponding test cases in api_test.go to ensure proper functionality.

Fix #1845

The changes introduce a new `/format_query` API endpoint to handle query formatting in the Prometheus API. This includes implementing the `FormatQuery` function in `api.go` and adding corresponding test cases in `api_test.go` to ensure proper functionality.

Signed-off-by: yshngg <yshngg@outlook.com>
@yshngg yshngg force-pushed the feature/format-query branch from 4c76b54 to 1be9221 Compare July 30, 2025 09:09

@bwplotka bwplotka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing, thanks!

Comment thread api/prometheus/v1/api.go Outdated
Co-authored-by: Bartlomiej Plotka <bwplotka@gmail.com>
Signed-off-by: Yusheng Guo <113574546+yshngg@users.noreply.github.com>
@bwplotka bwplotka merged commit 40dd084 into prometheus:main Aug 20, 2025
8 checks passed
@bwplotka

Copy link
Copy Markdown
Member

Ah I missed this, but we need to add this method to our unfortunate interface https://github.com/yshngg/client_golang/blob/83a97306104f6a869e14b28363d63b256c484c84/api/prometheus/v1/api.go#L464 (unfortunate because we should not have it, especially so large - maybe we can remove it one day)

@yshngg

yshngg commented Aug 20, 2025

Copy link
Copy Markdown
Contributor Author

Understood — my apologies, I missed that as well. I’ll reopen a new Pull Request to add the FormatQuery method to the API interface.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Proposal to Add FormatQuery Method for API

2 participants